package com.twu.biblioteca;

import java.net.SocketPermission;

/**
 * Created with IntelliJ IDEA.
 * User: Thoughtworker
 * Date: 8/26/13
 * Time: 2:41 PM
 * To change this template use File | Settings | File Templates.
 */
public class BookReserver implements Command {

    private BookGetter bookGetter;
    private Output output;

    public BookReserver(BookGetter bookGetter, Output output) {
        this.bookGetter = bookGetter;
        this.output = output;
    }


    public void execute(int order, boolean hasAccess)
    {
        if(hasAccess)
        {
            bookGetter.reserveBook();
        }
        else
        {
            output.printPleaseTalkToLibrarianMessage();
        }
    }

    public String getCommandName() {
        return "Reserve Book";
    }

    public void execute(boolean hasAccess)
    {
        if(hasAccess)
            bookGetter.reserveBook();
        else
            output.printPleaseTalkToLibrarianMessage();

    }


}
